import request from "@/utils/request"


// 新增检查表
export function postDataAdd(data) {
  return request({
    url: "/v1/cmdb/data/add?cmdb!modelNo=met_lp_inspect",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
  })
}

// 修改检查表
export function postDataUpdate(data) {
  return request({
    url: "/v1/cmdb/data/update?cmdb!modelNo=met_lp_inspect",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
  })
}

// 检查用户状态
export function queryUserStatus(userIds) {
  return request({
    url: `/v1/plugins/met/tencentyun/queryUserStatus?userIds=${userIds}`,
    method: "get",
  })
}

// 更新状态  转现场
export function updateInspectStatus(data) {
  return request({
    url: `/v1/plugins/met/lpInspectPlanUnit/updateMultiInspectStatus`,
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
  })
}

// 提交签署1
export function createFlowHtml(data) {
  return request({
    url: "/v1/plugins/met/tyesign/createFlowHtml",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
  })
}
// 提交签署2 --- 这个
export function createFlowInspect(data) {
  return request({
    url: "/v1/plugins/met/tyesign/createFlowInspect",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
  })
}
// 获取详情
export function findByPlanDetailId(data) {
  return request({
    url: "/v1/plugins/met/lpInspectPlanUnit/findByPlanDetailId",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
  })
}

// 查看防雷检查单位上传的佐证材料
export function findInspectProofs(params) {
  return request({
    url: `/v1/plugins/met/lpInspectPlanUnit/findInspectProofs`,
    method: "get",
    params
  })
}

export function searchMedia(detailId) {
  return request({
    url: `/v1/plugins/met/tencentyun/searchMedia?detailId=${detailId}`,
    method: "get",
  })
}